<?php
require_once 'PHPFaces.php';

class jQuery{
	
    public $s;
    
    public function __construct($selector){
        $this->s = $selector;
    }
    
    public function __call($method, $args){
    	echo '$("',$this->s,'").'.$method.'(';
    	$quantos = sizeof($args);
    	for($i=0;$i<$quantos;$i++)
    		echo PHPFaces::json($args[$i]);	
    	echo ');';
        return $this;
    }
    
}

function jQuery($selector){
    return new jQuery($selector);
}

?>